package top.heue.utils.log

import top.heue.utils.log.base.IBaseHandler
import top.heue.utils.log.base.IBasePrinter
import top.heue.utils.log.base.ILRuntime

interface IL {
    /**日志总开关*/
    var loggable: Boolean

    /**日志打印等级*/
    var logLevel: LogLevel

    /**运行环境，为协程准备*/
    var runtime: ILRuntime?

    /**处理日志信息，将对应内容通过Handler处理后交给所有Printer输出*/
    fun handle(logLevel: LogLevel, tag: Any, vararg any: Any?)
    fun addHandler(handler: IBaseHandler<*>)
    fun addPrinter(printer: IBasePrinter)

    /**
     * Throwable To String
     */
    val Throwable.string: String

    /**
     * 当前执行方法
     */
    val current: Pair<String, String>

    /**
     * 抓取应用崩溃信息（跨平台）
     */
    fun catchError(threadHandler: (thread: Any?, throwable: Throwable) -> Unit): L
}

